package practice07;

public class Teacher extends Person{
    private Klass klass;
    public Teacher(String name, int age, Klass klass) {
        super(name,age);
        this.klass = klass;
    }

    public Teacher(String tom, int age) {
        super(tom, age);
    }

    public Object getKlass() {
        return klass;
    }

    public String introduce(){
    if (klass != null){
        return "My name is "+ getName() +". I am "+ getAge() +" years old. I am a Teacher. I teach Class 2.";
    }else {
        return "My name is "+ getName() +". I am "+ getAge() +" years old. I am a Teacher. I teach No Class.";
    }
    }
    public String introduceWith(Student Student) {
        if (Student.klass == this.klass){
           return  "My name is "+ getName()+". I am "+getAge()+" years old. I am a Teacher. I teach Jerry.";
        }else {
            return "My name is "+getName()+". I am "+getAge()+" years old. I am a Teacher. I don't teach Jerry.";
        }
    }
}
